The generation of appropriate behaviors relies on the ability to modulate internal states based on context and recent experience, and this ability is often defective in mental illnesses such as schizophrenia. Understanding the cellular and molecular mechanisms of internal state modulation may therefore provide insight into the nature of these disorders. The nematode Caenorhabditis elegans offers an excellent system to address these questions. It has a simple nervous system consisting of exactly 302 neurons with known connectivity and multiple genetic tools are available to monitor and manipulate individual neurons in behaving animals. C. elegans contains many of the same neurotransmitters and neuromodulators found in mammalian systems, suggesting that its circuits possess evolutionarily conserved properties. These characteristics will allow us to elucidate basic mechanisms that circuits use to generate appropriate behaviors. C. elegans foraging off-food displays a behavioral sequence that allows it to maximize its encounter with food sources. When removed from food, for the first 15 minutes, C. elegans enters a behavioral state called local search in which it performs many reorientations, exploring a small area and maximizing its chance of locating the previous food source. After 15 minutes, if it fails to find food, it entersa state called dispersal in which it suppress reorientations, exploring large areas and maximizing its encounter with random food sources. This sequence, which occurs in a constant external environment, represents a transition in the internal state of the animal that allows it to use context and recent experience to generate an appropriate behavior. To understand the cellular and molecular mechanisms that mediate the off-food foraging behavioral transition, we propose the following specific aims: 1) to identify the neurons important for off-food foraging using optogenetics; 2) to correlate off-food neuronal activity patterns with behavior using in vivo calcium imaging in freely moving animals; 3) to identify genes necessary for the behavioral sequence by performing a candidate genetic screen. The completion of these specific aims will yield fundamental insight into how circuits can change internally to elicit flexible behaviors. Th approaches in this proposal provide a platform to train a future physician scientist to study neural circuitry and behavior.